GATE CSE 2016 SET-1


Q11.

Consider the following directed graph: The number of different topological orderings of the vertices of the graph is
GateOverflow

Q12.

Consider the following directed graph: The number of different topological orderings of the vertices of the graph is
GateOverflow

Q13.

What will be the output of the following pseudo-code when parameters are passed by reference and dynamic scoping is assumed? a=3; void n(x){x=x*a; print(x);} void m(y){a=1;a=y-a;n(a);print(a);} void main(){m(a);}
GateOverflow

Q14.

What will be the output of the following C program? void count(intn){ static intd=1; printf("%d ",n); printf("%d ",d); d++; if(n&gt1) count(n-1); printf("%d ",d); } void main(){ count(3); }
GateOverflow

Q15.

Consider the following C program. void f(int,short); void main() { int i=100; short s=12; short *p=&s __________ ;//calltof() } Which one of the following expressions, when placed in the blank above, will NOT result in a typec hecking error?
GateOverflow

Q16.

Consider the following C program. #include < stdio.h > void mystery(int *ptra,int *ptrb){ int *temp; temp =ptrb; ptrb =ptra; ptra =temp; } int main(){ int a=2016,b=0,c=4,d=42; mystery(&a, &b); if (a < c) mystery(&c, &a); mystery(&a, &d); printf("%dn", a); } The output of the program is _________.
GateOverflow

Q17.

An operator delete(i) for a binary heap data structure is to be designed to delete the item in the i-th node.Assume that the heap is implemented in an array and i refers to the i-th index of thearray.If the heap tree has depth d (number of edges on the path from the root to the farthest leaf),the n what is the time complexity to re-fix the heap efficiently after the removal of the element?
GateOverflow

Q18.

Consider the two cascaded 2-to-1 multiplexers as shown in the figure. The minimal sum of products form of the output X is
GateOverflow

Q19.

Consider the following code segment. x =u-t; y =x*v; x =y+w; y =t-z; y =x*y; The minimum number of total variables required to convert the above code segment to static single assignment form is__________ .
GateOverflow

Q20.

The size of the data count register of a DMA controller is 16 bits.The processor needs to transfer a file of 29,154 kilobytes from disk to main memory.The memory is byte addressable. The minimum number of times the DMA control lerneeds to get the control of the systembus from the processor to transfer the file from the disk to main memory is ____.
GateOverflow